home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 33 / 033.d81 / vertical bar dem (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  1KB  |  46 lines

  1. 5 poke53280,6:poke53281,6
  2. 10 print"[147]";:dim a%(15),d%(72)
  3. 15 print"         vertical bar chart demo"
  4. 20 print"f[155]ull or h[155]alf column? (f[155]/h[155])  [164][157]";
  5. 22 geta$:ifa$<>"h"anda$<>"f"then22
  6. 23 printa$
  7. 25 ifa$="h"thenpm=1:goto40
  8. 30 print"[155]dual color?  (y[155]/n[155])  [164][157]";
  9. 32 getq$:ifq$<>"y"andq$<>"n"then32
  10. 33 printq$
  11. 35 if q$="y" then dc=3
  12. 40 print"zero bottom?  (y[155]/n[155])  [164][157]";
  13. 42 getq$:ifq$<>"y"andq$<>"n"then42
  14. 43 printq$
  15. 45 if q$="n" then z=1
  16. 50 nb=36:i=2:if b or dc then nb=72:i=1
  17. 60 for x=1 to nb step 2:d%(x)=(40*rnd(1)+1)*z: rem bottom
  18. 70 d%(x+1)=d%(x)+99*rnd(1)+8: rem top
  19. 80 if d%(x+1)>d%(0) then d%(0)=d%(x+1): rem highest top
  20. 90 next
  21. 100 data 97,126,97,123
  22. 110 for x=0to3:read a%(x):next:r=2
  23. 120 if b=0 then for x=0to15:read a%(x):next:r=8
  24. 130 data 224,228,239,249,226,120,119,99,224,100,111,121,98,248,247,227
  25. 140 hv=r*20:s%=1+d%(0)/hv:iv=s%*r
  26. 150 print chr$(147)"demo chart":for x=1 to 40:l$=l$+chr$(164):next
  27. 160 for x=20 to 0 step-1:x$=mid$(str$(iv*x),2)
  28. 170 p$=x$+left$(l$,40-len(x$)):print p$;:next:x%=1
  29. 175 print"[145]                                       ";
  30. 176 print" [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][145]";
  31. 180 for x=1 to nb step 2:b%=d%(x)/s%:t%=d%(x+1)/s%
  32. 190 e=b%-(int(b%/r)*r):gosub240:e=r
  33. 200 b%=b%+r:if b%<t% then gosub 240:goto 200
  34. 210 b%=t%:e=t%-(int(t%/r)*r):if e then e=e+r:gosub 240
  35. 220 if dc then cc=abs(cc-1)
  36. 230 x%=x%+i:next:goto300
  37. 240 y%=b%/r:sa=1866-(y%*40)+x%:poke sa,a%(e):ifpmthenpokesa+1,a%(e)
  38. 250 pokesa+54272,dc-cc:ifpmthenpokesa+54272+1,dc-cc
  39. 260 return
  40. 300 print"[154] press [159]a [154]to see another demo, [159]q [154]to quit"
  41. 310 geta$:ifa$<>"a"anda$<>"q"then310
  42. 320 ifa$="a"thenrun
  43. 330 print"[147]";:open15,8,15,"r0:hello connect=hello connect":input#15,er:close15
  44. 335 ifer<>63thenend
  45. 340 load"hello connect",8
  46.